package com.example.myapplication.data;

import androidx.room.Entity;
import androidx.room.PrimaryKey;
import java.util.Date;

@Entity(tableName = "records")
public class Record {
    @PrimaryKey(autoGenerate = true)
    private int id;
    private boolean isExpense;
    private String category;
    private double amount;
    private long date;
    private String note;

    public Record(boolean isExpense, String category, double amount, long date, String note) {
        this.isExpense = isExpense;
        this.category = category;
        this.amount = amount;
        this.date = date;
        this.note = note;
    }

    // Getters and Setters
    public int getId() { return id; }
    public void setId(int id) { this.id = id; }
    public boolean isExpense() { return isExpense; }
    public void setExpense(boolean expense) { isExpense = expense; }
    public String getCategory() { return category; }
    public void setCategory(String category) { this.category = category; }
    public double getAmount() { return amount; }
    public void setAmount(double amount) { this.amount = amount; }
    public long getDate() { return date; }
    public void setDate(long date) { this.date = date; }
    public String getNote() { return note; }
    public void setNote(String note) { this.note = note; }

    @Override
    public String toString() {
        return "Record{" +
                "id=" + id +
                ", isExpense=" + isExpense +
                ", category='" + category + '\'' +
                ", amount=" + amount +
                ", date=" + new Date(date) +
                ", note='" + note + '\'' +
                '}';
    }
} 